package com.tangchao.client.sdh.vo
{
	import com.tangchao.client.entities.User;
	import com.tangchao.client.sdh.definition.DFState;
	import com.tangchao.client.sdh.definition.GlobalDefine;
	import com.tangchao.client.sdh.view.role.BaseRole;

	public class Player
	{
		public var user:User;
		public var ui:BaseRole;
		
		public function setStat(val:int):void
		{
			if(ui)
			{
				ui.setStat(val);
			}
		}
		
		public function stopClock():void
		{
			if(ui)
			{
				ui.noTime();
			}
		}
		
		public function tryBet(maxScore:int):void
		{
			if(ui)
			{
				ui.setTimer(GlobalDefine.JIAOFENWAITSEC, null);
			}
		}
		
		//-1 - 不叫
		public function doBet(value:int):void
		{
			if(ui)
			{
				ui.doBet(value);
			}
		}
		
		public function tryPlayOut(onTimerOver:Function=null):void
		{
			if(ui)
			{
				ui.setTimer(GlobalDefine.OUTCARDSEC, onTimerOver);
			}
		}
		
		public function tryDao():void
		{
			
		}
		
		public function doDao():void
		{
			if(ui)
			{
				ui.setStat(DFState.STAT_DAO);
			}
		}
		
		public function tryGen():void
		{
			
		}
		
		public function doGen():void
		{
			if(ui)
			{
				ui.setStat(DFState.STAT_GEN);
			}
		}
		
		public function tryFan():void
		{
			
		}
		
		public function doFan():void
		{
			if(ui)
			{
				ui.setStat(DFState.STAT_FAN);
			}
		}
		
		public function doTuoGuan(isTuoGuan:Boolean):void
		{
			if(ui)
			{
				ui.doTuoguan(isTuoGuan);
			}
		}
		
		//设置该玩家是否为庄家
		public function setZJ(isZJ:Boolean):void
		{
			if(ui)
			{
				ui.setZJ(isZJ);
			}
		}
		
		public function destory():void
		{
			if(ui)
			{
				ui.destory();
			}
		}
		
		public function setViewPos(viewPos:int):void
		{
			if(ui)
			{
				ui.setViewPos(viewPos);
			}
		}
		
		public function showHandCards(cardArr:Array):void
		{
			
		}
	}
}